<template>
  <div class="content">
    <div class="rheader">
      <h3><span>我听过的歌</span></h3>
      <h4>累计听歌1855首</h4>
      <span class="songsall">所有时间</span>
      <i></i>
      <span class="songsweek">最近一周</span>
    </div>
    <div class="bottom">
      <ul>
        <li v-for="(item, index) in songList"
          :key="item.id"
          :class="index % 2 === 0 ? 'bg' : ''"
          @click="toSong(item.id)">
          <div class="barrel">
            &nbsp;&nbsp;<span class="number">{{++index}}</span>.&nbsp;&nbsp;
            <img src="../images/icon.png">&nbsp;&nbsp;&nbsp;
            <span class="liItem">{{item.name}}</span>&nbsp;&nbsp;
            <span class="signerName">-&nbsp;&nbsp;{{item.singer}}</span>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'LookMore',
  created () {
    this.$store.dispatch('getSongList');
  },
  computed: {
    ...mapState({
      songList: state => state.myMusic.songList
    })
  }
}
</script>

<style lang="less" scoped>
.bg {
  background-color: rgb(238, 238, 238);
}
.content{
  width: 980px;
  background-color: rgb(255, 255, 255);
  margin: 0 auto;
  .rheader {
  width: 900px;
  height: 35px;
  background: rgb(255, 255, 255);
  padding-top: 50px;
  margin: 0 auto;
  h3 {
    font-size: 20px;
    line-height: 28px;
    float: left;
    font-weight: normal;
  }
  h4 {
    float: left;
    display: inline;
    margin-top: 5px;
    margin-left: 10px;
    line-height: 26px;
    font-weight: 400px;
    color: #666;
  }
  .songsall {
    line-height: 26px;
    color: #666;
    cursor: pointer;
    float: right;
    margin-left: 8px;
  }
  i {
    width: 1px;
    height: 12px;
    margin-top: 7px;
    background: #999;
    font-style: normal;
    font-size: inherit;
  }
  .songsweek {
    line-height: 26px;
    color: #333;
    font-weight: 700;
    float: right;
    margin-left: 8px;
  }
}

.bottom {
  width: 900px;
  margin: 0 auto;
  border: 1px solid #c6c5c5;
  border-top: 2px solid rgb(194, 12, 12);
  ul {
    display: block;
    li {
      display: list-item;
      width: 898px;
      height: 38px;
      line-height: 38px;
      .barrel {
        .number {
          font-size: 16px;
          // font-weight: 300px;
        }
        img {
          width: 17px;
          height: 17px;
          cursor: pointer;
        }
        .liItem {
          font-size: 14px;
          // font-weight: 100px ;
          cursor: pointer;
        }
        .signerName {
          color: #aeaeae;
        }
      }
    }
  }
}
}

</style>